package com.medical.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.medical.system.common.Result;
import com.medical.system.mapper.DepartmentMapper;
import com.medical.system.model.Department;
import com.medical.system.service.DepartmentService;
import com.medical.system.vo.DepartmentVo;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {
    @Override
    public IPage<Department> selectPage(IPage<Department> iPage, DepartmentVo departmentVo) {
        return this.baseMapper.selectPage(iPage, departmentVo);
    }

    //获取科室列表
    @Override
    public Result getList() {
        List<Department> departments = this.baseMapper.selectList(null);
        return Result.ok(departments);
    }
}
